package ooseminar.parking;

import java.util.List;

class SpaceFirstParkingLotsChooser implements ParkingLotsChooser {
  public ParkingLots chooseParkingLots(List<ParkingLots> parkingLotsList) {
    ParkingLots chosenParkingLot = parkingLotsList.get(0);
    for (ParkingLots parkingLots : parkingLotsList) {
        if ((int) parkingLots.get(new ParkingLots.NonComericalBasedChooserRateContextAction<Integer>() {

            public Integer calculate(int size1, int idle) {
                return idle;
            }
        }) > chosenParkingLot.get(new ParkingLots.NonComericalBasedChooserRateContextAction<Integer>() {

            public Integer calculate(int size1, int idle) {
                return idle;
            }
        })) {
            chosenParkingLot = parkingLots;
        }
    }
    return chosenParkingLot;
}
}
